package com.tsingteng.cosfun.utils;

import android.view.animation.LinearInterpolator;

/**
 * 描述: 动画插值器
 * 创建人: 肖利
 *时间: 2018/7/30
 * qq: (872179966)
 */

public class JellyInterpolator extends LinearInterpolator {
    private float factor;

    public JellyInterpolator() {
        this.factor = 0.15f;
    }

    @Override
    public float getInterpolation(float input) {
        return (float) (Math.pow(2, -10 * input)
                * Math.sin((input - factor / 4) * (2 * Math.PI) / factor) + 1);
    }
}
